/*
 * @Description: 
 * @Author: code-shan
 * @Date: 2022-08-17 09:31:19
 * @LastEditTime: 2022-10-18 10:26:48
 * @LastEditors: code-shan
 * @FilePath: \question-bank-admin\src\api\user.js
 */

import request from '@/utils/request'

const api = {
    list: '/user/',
    active: '/user/active/'
}

//获取用户列表
export function getUserList(params) {
    return request({
        url: api.list,
        method: 'get',
        params
    })
}

//根据获取用户的详情
export function getUserDetail(id) {
    return request({
        url: `${api.list}${id}/`,
        method: 'get',
    })
}

//删除用户
export function deleteUser(id) {
    return request({ url: `${api.list}${id}/`, method: 'delete' })
}

//修改用户详情
export function updateUser(id,data) {
    return request({ url: `${api.list}${id}/`, method: 'patch', data })
}

//管理员激活用户
export function activateUser(data) {
    return request({ url: `${api.active}`, method: 'post', data})
}
